package com.spzx.product.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;

import com.spzx.common.core.domain.R;
import com.spzx.product.api.factory.RemoteProductFallbackFactory;
import com.spzx.product.api.vo.ProductSkuVo;
import com.spzx.product.api.vo.SkuPriceVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author LOGIN
 * @title RemoteProductService
 * @create 2025/7/26 10:30
 * @description
 */
@FeignClient(contextId = "remoteProductService",
        value = ServiceNameConstants.PRODUCT_SERVICE,
        fallbackFactory = RemoteProductFallbackFactory.class)
public interface RemoteProductService {

    @Operation(summary = "获取商品SKU详情")
    @GetMapping("/productSku/getproductSku/{skuId}")
    R<ProductSkuVo> getproductSku(
            @Parameter(description = "商品的 skuid")
            @PathVariable("skuId") Long skuId,
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/productSku/getSkuPriceList")
    R<List<SkuPriceVo>> getSkuPriceList(
            @RequestBody List<Long> skuIdList,
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
